package edu.ahut.corejava3;

import java.util.Stack;

public class StackDemo {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<Integer>();
        for (int i = 0; i < 10; i++) {
            stack.push(i);//入栈
        }

        while (!stack.empty()) {//if(x==true) => if(x)    if(x==false)==>if(!x)
            System.out.println(stack.peek());//栈顶元素
            stack.pop();//弹出栈顶元素
        }


//        String name=null;
//        if("123".equals(name)){// if("123".equals(name))
//            System.out.println();
//        }
    }
}
